﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using Microsoft.Xna.Framework;

namespace WindowsGame1
{
    class AI : Robot
    {
        public AI()
        {
        }

        public override void Update(GameTime gameTime)
        {
            position += speed;
            if (position.X + 21 > Game1.ScreenWidth || position.X < 0)
            {
                position -= speed;
                speed.X = -speed.X;
                ChangeDirection(speed.X > 0 ? "right" : "left");
            }
            if (position.Y + 25 > Game1.ScreenHeight || position.Y < 0)
            {
                position -= speed;
                speed.Y = -speed.Y;
                ChangeDirection(speed.Y > 0 ? "down" : "up");
            }
            
            base.Update(gameTime);
        }

        public override void Draw(Microsoft.Xna.Framework.Graphics.SpriteBatch spriteBacth)
        {
            base.Draw(spriteBacth);
        }
    }
}
